package com.jsmao.liteflowdemo.demos.cmp;

import com.yomahub.liteflow.core.FlowExecutor;
import com.yomahub.liteflow.flow.LiteflowResponse;
import com.yomahub.liteflow.slot.DefaultContext;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

@Component
public class YourClass{
    
    @Resource
    private FlowExecutor flowExecutor;
    
    public void testConfig(String  chainId){
        // 执行chain1流程
        LiteflowResponse response = flowExecutor.execute2Resp(chainId, "1");
        System.out.println("执行结果: " + response.isSuccess() + ", 信息: " + response.getMessage());

        LiteflowResponse response1 = flowExecutor.execute2Resp("chain1", "arg", DefaultContext.class);
        System.out.println("执行结果: " + response1.isSuccess() + ", 信息: " + response1.getMessage());

    }
}
